package com.tvpush.manage.core.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.tvpush.manage.core.entity.Brand;
import com.tvpush.manage.core.mapper.BrandMapper;
import com.tvpush.manage.core.service.BrandService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author ouyangzn
 * @since 2019-03-22
 */
@Service
public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements BrandService {

    @Override
    public Page<Brand> list(String allyId) {
        return selectPage(new Page<>(0, Integer.MAX_VALUE), new EntityWrapper<Brand>().eq(Brand.ALLY_ID, allyId));
    }

    @Override
    public void add(Brand brand) {
        insert(brand);
    }

    @Override
    public void update(Integer id, Brand brand) {
        brand.setId(id);
        updateById(brand);
    }
}
